Repository navigation
fix(arc): withhold the heartbeat until a scale set's listener has settled - #265
Merged
Merged
Conversation
…tled The controller deletes and re-creates a scale set's listener whenever the set's spec changes, and the autoscaler patches maxRunners often enough that the shared exadev-runners set had its listener replaced 21 times in two hours. Each replacement drops the session with GitHub, and jobs queued around it stayed unassigned for hours while the new listener was Running and runners started for other jobs. The heartbeat counted any Running listener, so it kept vouching for the fleet and runner-fallback-action kept routing those jobs to it. A listener now counts only once it has run for HEARTBEAT_LISTENER_SETTLE_SECONDS, one heartbeat interval by default, so a scale set whose listener keeps being replaced is not vouched for and its jobs fall back to hosted runners.
…of reading as no listener A jq failure on the listener pods was turned into a count of zero, so the heartbeat withheld with the reason "no running listener" and the real error was discarded. The failure now stops the tick with jq's own message, which still withholds the refresh, and a test pins it.
|
🎉 This PR is included in version 3.6.1 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stop
heartbeat.shvouching for a scale set whose listener the controller has just re-created.The controller deletes and re-creates a listener whenever its scale set's spec changes, and the autoscaler patches
maxRunnerson the pooled sets often. The listener and controller logs on the fleet's cluster showed the sharedexadev-runnerslistener re-created 21 times between 10:53 and 11:47 UTC on 2026-11-19. Each replacement drops the session with GitHub, and the heartbeat counted any Running listener, so it kept the gist fresh through the churn.A listener now counts only once it has run for
HEARTBEAT_LISTENER_SETTLE_SECONDS(default: one heartbeat interval). A scale set without such a listener is reported infleet-health.jsonand the timestamp is not refreshed, so jobs fall back to hosted runners.Not covered: what makes the autoscaler's patches re-create the listener. This is also not the cause of jobs from a public repository staying queued: the default runner group does not allow public repositories, so GitHub never offers those jobs to the scale set at all.
Tests: three new cases in
tests/unit/test_heartbeat.py(listener inside the settle time withholds, older than it does not, an old listener beside a new one does not). The module passes, and the first case fails against the previous script.